package com.base.cn.platform.os.service.manage.user.integral;

import com.base.cn.platform.os.entity.user.integral.CusUserIntegralRule;
import com.base.cn.platform.os.entity.user.integral.IntegralRule;
import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;
import java.util.Map;

/**
 *  积分规则接口
 *
 * @author ll
 * @create 2018-04-25
 */
@FeignClient(value = BaseService.appName,configuration = FeignAuthConfig.class)
public interface CusUserIntegralRuleService extends BaseService {


    /**
     * 搜索经验规则明细列表
     * @param cusUserIntegralRule
     * @return
     */
    @RequestMapping(contextPath + "/user/queryAjaxUserIntegralRuleList")
    Map<String,Object> queryAjaxUserIntegralRuleList(@RequestBody Map<String, Object> cusUserIntegralRule,
                                                     @RequestParam(value = "currentPage", required = false, defaultValue = "1") Integer currentPage);



    /**
     * 添加修改方法只能修改分数
     * @param userIntegralRule
     * @return
     */
    @RequestMapping(contextPath + "/user/saveUserIntegralRule")
    Map<String ,Object> saveUserIntegralRule(@RequestBody Map<String, Object> userIntegralRule);


    /**
     * 修改积分规则状态
     * @param integralRuleId
     * @param status
     * @return
     */
    @RequestMapping(contextPath + "/user/updateUserIntegralRuleStatus")
    Map<String,Object> updateUserIntegralRuleStatus(@RequestParam("integralRuleId") BigDecimal integralRuleId,
                                                    @RequestParam("status") Integer status);




    /**-----------------------------------积分管理-------------------------------------*/


    /**
     * 添加积分规则key
     * @param integralRule
     * @return
     */
    @RequestMapping(contextPath+"/user/addIntegralRule")
    Map<String,Object> addIntegralRule(@RequestBody Map<String, Object>integralRule );

    /**
     * 获取全部积分规则
     * @param type  CONFIG 积分配置  RULE 积分规则
     * @return
     */
    @RequestMapping(contextPath + "/user/integralRuleData")
    Map<String, IntegralRule> integralRuleData(@RequestParam("type") String type);

    /**
     * 更新积分规则
     * @param
     * @return
     */
    @RequestMapping(contextPath+"/user/updateIntegralRuleConfig")
    Map<String, Object> updateIntegralRuleConfig(@RequestBody Map<String,Object> data);

    /**
     * 获取积分规则
     * @param actionKey 积分规则
     * @return
     */
    @RequestMapping(contextPath+"/user/getUserIntegralRuleByKey")
    IntegralRule getUserIntegralRuleByKey(@RequestParam String actionKey);
}
